<template>
  <div>
    <div class="BOXstyle">
      <div class="titleStyle">不动产抵押表</div>
      <div>
        <span class="conversion">二抵</span>

        <el-radio-group v-model="form.secondTable">
          <span class="optionsStyle"><el-radio :label="1">是</el-radio></span>
          <span class="optionsStyle"><el-radio :label="0">否</el-radio></span>
        </el-radio-group>
      </div>

      <div>
        <span class="conversion">三抵</span>

        <el-radio-group v-model="form.threeTable">
          <span class="optionsStyle"><el-radio :label="1">是</el-radio></span>
          <span class="optionsStyle"><el-radio :label="0">否</el-radio></span>
        </el-radio-group>
      </div>

      <div>
        <span class="conversion">抵押物清单</span>

        <el-radio-group v-model="form.mortgageList">
          <span class="optionsStyle"><el-radio :label="1">需要</el-radio></span>
          <span class="optionsStyle"
            ><el-radio :label="0">不需要</el-radio></span
          >
        </el-radio-group>
      </div>
    </div>

    <el-button
      type="primary"
      style="width: 150px; margin-left: 40%; margin-top: 20px"
      @click="downloadForm"
      >下载</el-button
    >
  </div>
</template>
<script>
import {
  dbajfdownload,
  ryddownload,
  lyfdownload,
  lybdownload,
} from "../../assets/js/api";
export default {
  props: ["isContract","showForm"],
  data() {
    return {
      form: {
        secondTable: 0, //二抵!
        threeTable: 0, //三抵!
        mortgageList: 0, //抵押物清单!
      },
    };
  },
  methods: {
    downloadForm() {
      this.form.productType=this.showForm.productType;
      //担保安居分!
      if (this.isContract == 4) {
        dbajfdownload(this.form).then((res) => {
          window.open(res, "_self");
        });
      }
      //乐业分!
      if (this.isContract == 3) {
        lyfdownload(this.form).then((res) => {
          window.open(res, "_self");
        });
      }
      //融银贷!
      if (this.isContract == 2) {
        ryddownload(this.form).then((res) => {
          window.open(res, "_self");
        });
      }
      //担保安居分!
      if (this.isContract == 1) {
        lybdownload(this.form).then((res) => {
          window.open(res, "_self");
        });
      }
    },
  },
};
</script>
<style lang="less" scoped>
.conversion {
  display: inline-block;
  margin-left: 20px;
  margin-bottom: 12px;
  margin-top: 12px;
  font-size: 16px;
  text-align: right;
  margin-right: 20px;
  width: 80px;
}
.optionsStyle {
  display: inline-block;
  width: 80px;
  text-align: left;
}
.BOXstyle {
  border: 1px solid #eeeeee;
}
.titleStyle {
  font-size: 16px;
  font-weight: bold;
  margin-top: 10px;
  margin-bottom: 10px;
  margin-left: 5px;
  width: 120px;
  text-align: left;
}
</style>